Ext.define('channel.commodity.CommodityTools',{
	extend : 'Ext.panel.Panel',
	alias: 'widget.commoditytools',
	initComponent : function(){
		
		this.goodsIdSearchForm=Ext.create('Ext.form.Panel', {
        border: false,
        fieldDefaults: {
            labelWidth: 55
        },
        url: 'save-form.php',
        defaultType: 'textfield',
        bodyPadding: 5,
        items: [{
            fieldLabel: '文轩店铺编号[URL No.]',
			labelWidth: 140,
			xtype : 'numberfield',
            name: 'shopNo',
			allowBlank: false
        }],
		buttons : [{text:'查询',scope:this,handler:this._goodIdSearch}]
		});
	this.center = Ext.create('Ext.Panel', {
        id:'tools-panel',
        layout: {
            type: 'table',
			columns: 4
        },
        // applied to child components
        defaults: {frame:false, width:300, height: 200},
        items:[{
            title:'查询商品编码',
			items:this.goodsIdSearchForm
        },{
            title:'装修...'
        },{
            title:'装修...'
        }]
    });
		this.items = [this.center];
		this.callParent();
	},
	_goodIdSearch:function(){
		if (this.goodsIdSearchForm.form.isValid()){
			var dataIn = this.goodsIdSearchForm.form.getValues();
			var url = '/ecommodity/shopno/'+dataIn.shopNo+'/convert.json';
			channel.openLink({
				url	:url,
				params : dataIn,
				scope : this,
				masker : this,
				onSuccess : function(rs){
					Ext.Msg.alert('结果',rs.result);
				}
			});
		}
	}
});